package com.lzs.adx.web.modules.adx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lzs.adx.commmon.service.impl.CrudServiceImpl;
import com.lzs.adx.web.modules.adx.dao.ReportUrlDao;
import com.lzs.adx.web.modules.adx.dto.ReportUrlDTO;
import com.lzs.adx.web.modules.adx.entity.ReportUrlEntity;
import com.lzs.adx.web.modules.adx.service.ReportUrlService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 多-监测
 *
 * @author wangzhijun 825400558@qq.com
 * @since 1.0.0 2024-09-26
 */
@Service
public class ReportUrlServiceImpl extends CrudServiceImpl<ReportUrlDao, ReportUrlEntity, ReportUrlDTO> implements ReportUrlService {

    @Override
    public QueryWrapper<ReportUrlEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        String urlMd5 = (String)params.get("urlMd5");
        String dspId = (String)params.get("dspId");
        QueryWrapper<ReportUrlEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);
        wrapper.eq(StringUtils.isNotBlank(urlMd5), "url_md5", urlMd5);
        wrapper.eq(StringUtils.isNotBlank(dspId), "dsp_id", dspId);

        return wrapper;
    }


}